#include <iostream>
#include <thread>
#include <string>
#include <memory>
#include "HttpServer.hpp"
#include "Log.hpp"

static void Usage(const std::string& proc)
{
    std::cout << "Usage:\n\t" << proc << " port" << std::endl;
}

int main(int argc, char* argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(1);
    }

    int port = std::stoi(argv[1]);

    std::shared_ptr<HttpServer> http_server(new HttpServer(port));
    http_server->InitServer();

    LOG(INFO) << "http_server init success\n";

    while (true)
    {
        http_server->Loop();
    }




    return 0;
}
